package com.training.bt.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.training.bt.entity.DownloadHistory;

@Mapper
public interface DownloadHistoryMapper extends BaseMapper<DownloadHistory> {
    @Select("SELECT EXISTS(SELECT 1 FROM download_history WHERE user_id = #{userId} AND resource_id = #{resourceId})")
    Integer existsById(@Param("userId") Long userId,@Param("resourceId") Long resourceId);

}
